#import "GTKWidget.h"
#import <gtk/gtk.h>

@implementation GTKWidget

+ new                  // factory method
{
	self = [super new];
	[self createWidget];
	return self;
}
// Set/get parent of widgets
- parent: (id) parentInstance
{
	[parentInstance addWidget: self];
	parentPointer = parentInstance;
	return self;
}
- parent
{
	return parentPointer;
}
// 
- display
{
	return gtk_widget_get_display(widget);
}
// Set/get if the widget is sensitive (not greyed out)
- sensitive: (gboolean) sensitive
{
	gtk_widget_set_sensitive(widget, sensitive);
	return self;
}

// Show/hide the widget
- show
{
	gtk_widget_show(widget);
	return self;
}
- hide
{
	gtk_widget_hide(widget);
	return self;
}
- getWidgetPointer
{
	return widget;
}
- destroy
{
	gtk_widget_destroy(widget);
	[self free];
	[super free];
}
// Begin GTKWidget events
- onDestroy: function
{
	g_signal_connect (G_OBJECT (widget), "destroy", G_CALLBACK ( function ), self);
	return self;
}
@end
